// 存储
const _setStorage = (key, value)=>{
    localStorage.setItem(key, JSON.stringify(value));
}
// 查找
const _getStorage = (key)=>{
	try {
		return JSON.parse(localStorage.getItem(key));
	}catch{
		if(key == 'token') {
			_removeAllStorage()
		}
	}
	return ""
}
 
const _getForIndexStorage = (index)=>{
    return localStorage.key(index)
}
// 删除
const _removeStorage = (key)=>{
    localStorage.removeItem(key);
}
// 清空
const _removeAllStorage = ()=>{
    localStorage.clear();
}
 
export default {
    _removeAllStorage,
    _removeStorage,
    _getForIndexStorage,
    _getStorage,
    _setStorage,
}